/**
* 作者: clz
* 日期: 2025-05-07 01:29:01
* 备注: 联盟限时充值信息
*/
package com.motu.monstercity.server.game.userdata;

import com.motu.monstercity.server.game.logic.UnionManager;
import com.motu.vertx.module.utility.toolset.ErrorWord;
import com.motu.vertx.module.utility.toolset.TimeUtils;
import io.vertx.core.json.JsonArray;

public class UnionActChargeInfo extends UnionActChargeInfoModel {
	public UnionActChargeInfo() {
		super();
	}
	public UnionActChargeInfo(long unionId,long startTime) {
		putId(unionId);
		putNum(1);
		putActTime(startTime);
	}

	public void reset() {
		long curTime = TimeUtils.getCurTime();
		if (!TimeUtils.isSameWeek(curTime, getActTime())){
			//重置限时充值活动数据
			JsonArray actChargeTimeArray = UnionManager.getUnionActChargeTime();
			if(actChargeTimeArray.size() > 0) {
				long startTime = actChargeTimeArray.getLong(0);
				putActTime(startTime);
				putNum(0);
				update();
			}

		}
	}
}
